/**
 * @file igs_ikv.h
 * @author Sheng Wen Peng
 * @date 25 Nov 2014
 * @brief 
 */

#ifndef IGS_IKV_H
#define IGS_IKV_H

//#define IKV_SELF_TEST

#include "driver_usart.h"
#include "driver_led.h"
#include "driver_timer.h"
#include "driver_bifgpio.h"

#include "optiga.h"
#include "optiga_curve.h"
#include "optiga_host.h" 

#include "display_utils.h"

#include "igs_task.h"
#include "igs_queue.h"
#include "igs_protocol.h"

#define COMMAND_IKV_INIT 0x0
#define COMMAND_IKV_CHALLENGE 0x1
#define COMMAND_IKV_WRITE 0x2
#define COMMAND_IKV_READ 0x3
#define COMMAND_IKV_LOCK 0x4
#define COMMAND_IKV_STATE 0x5

#define IGS_IKV_WRITE_OK 0x1
#define IGS_IKV_LOCK_OK 0x2
#define IGS_IKV_ERROR 0x03

void igs_ikv_init(void);
uint16_t igs_ikv_get_lock_ofs(void);
void igs_ikv_polling(void);

#endif

